<template>
	<view class="me">
		<navigator url="/pages/login/login">
			<button v-if="!userStore.token">登录</button>
			<button v-else @click="logout">注销</button>
		</navigator>
	</view>
</template>

<script setup>
	import {
		useUserStore
	} from "../../store/userStore.js"

	const userStore = useUserStore();

	function logout() {
		userStore.clearData();
	}
</script>

<style>

</style>